﻿<Window x:Class="ComputationVisualizer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:ComputationVisualizer"
        Title="Визуализация вычислений" Height="400" Width="700" WindowStartupLocation="CenterScreen" BorderBrush="White">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Close" Executed="CloseCommandBinding_Executed" CanExecute="CloseCommandBinding_CanExecute"/>
        <CommandBinding Command="ApplicationCommands.Open" Executed="OpenCommandBinding_Executed" CanExecute="OpenCommandBinding_CanExecute"/>
        <CommandBinding Command="ApplicationCommands.New" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute"/>
    </Window.CommandBindings>
    <Window.Resources>
        <Style TargetType="ListViewItem">
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        </Style>
        <Style TargetType="GridSplitter">
            <Setter Property="Background" Value="LightBlue"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" MinHeight="30" Name="paletteGridRow"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" Name="mainGridMainClmn" MinWidth="50"/>
            <ColumnDefinition Width="0.3*" Name="mainGridCadresClmn" MinWidth="5"/>
        </Grid.ColumnDefinitions>
        <Menu Name="mainMenu" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0">
            <MenuItem Name="fileMenuItem" Header="Файл">
                <MenuItem Name="chooseDirectoryMenuItem" Header="Открыть каталог" Command="ApplicationCommands.Open" />
                <MenuItem Name="chooseFileMenuItem" Header="Открыть файл" Command="ApplicationCommands.New"/>
                <MenuItem Name="exportMenuItem" Header="Экспорт">
                    <MenuItem Name="imagesExprtMenuItem" Header="Изображения" Click="imagesExprtMenuItem_Click" />
                    <MenuItem Name="videoExprtMenuItem" Header="Видео" Click="videoExprtMenuItem_Click" />
                </MenuItem>
                <Separator/>
                <MenuItem Name="exitMenuItem" Header="Выход" Command="ApplicationCommands.Close" />
            </MenuItem>
        </Menu>
        <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0">кадры</Label>
            <ListView Grid.Row="1" Grid.Column="0" Name="framesListView" HorizontalAlignment="Stretch" SelectionChanged="framesListView_SelectionChanged"
                        Margin="5" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                        ScrollViewer.VerticalScrollBarVisibility="Auto" VerticalAlignment="Stretch">
            </ListView>
        </Grid>
        <ScrollViewer Grid.Column="0" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                      VerticalScrollBarVisibility="Auto" Margin="5">
            <local:CommonPaletteControl x:Name="commonPaletteControl"/>
        </ScrollViewer>
        <local:PlayerControl x:Name="player" Grid.Column="0" Grid.Row="1"/>
        <GridSplitter Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Right" Width="3" MouseDoubleClick="GridSplitter_MouseDoubleClick_1" />
        <GridSplitter Grid.Column="0" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="3" MouseDoubleClick="GridSplitter_MouseDoubleClick" />
        <StatusBar Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3">
            <Label Name="loadingLabel">
            </Label>
        </StatusBar>
    </Grid>
</Window>
